/**
 *
 */
package gemini.basic.dao.impl;

import gemini.basic.dao.GmnDao;
import gemini.basic.dao.UserStatusDao;
import gemini.basic.model.UserStatus;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 *
 *
 */
public class UserStatusDaoImpl extends HibernateDaoSupport implements UserStatusDao {

	private GmnDao gmnDao;

	public void setGmnDao(GmnDao gmnDao) {
		this.gmnDao = gmnDao;
	}

	@Override
	public List<UserStatus> getAll() {

		DetachedCriteria dtCri = DetachedCriteria.forClass(UserStatus.class);

		List<Object> lvList = gmnDao.findByCriteria(dtCri);
		List<UserStatus> result = null;

		if (lvList != null) {
			result = new ArrayList<UserStatus>(lvList.size());

			for (Object ob : lvList) {
				result.add((UserStatus) ob);
			}
		}

		return result;
	}

}
